/**
 * Created by 671643387 on 6/29/2017.
 */

/**
 *Ultimate Tools
 */

module.exports={
     CombinationTable:[
         [0,1,2],[0,1,3],[0,1,4],[0,2,3],[0,2,4],[0,3,4],
         [1,2,3],[1,2,4],[1,3,4],
         [2,3,4],
     ],
    /**
     * @param Hands = Map<Key,Value>
     * @PublicMethod
     */
    Combination:function(){
        return this.CombinationTable;
    },
    /**
     * Sort the K-V structure Collection
     * @param Collection = Map<Key,Value>
     * @constructor
     */
    Sort:function(Collection) {
        var keys=Object.keys(Collection);
    },
    /**
     * return Max PowerRating elements in a Array
     * @param Collection = Map<Key,Value>
     * @constructor
     */
    GetMaxValue:function(Collection){
        var uid = 0;
        var keys = Object.keys(Collection);
        for(var k=0;k<keys.length;k++){
               if(Collection[keys[k]]>uid){
                   uid=keys[k];
               }
        }
        return uid;
    },
    /**
     * Get max element in a array
     * @param Collection
     * @returns {number}
     */
    GetArrayMax:function(Collection){
        var e=0;
        for(var i=0;i<Collection.length;i++){
            if(Collection[i]>e){
                e=Collection;
            }
        }
        return e;
    },
    /**
     * Covert hands to Array
     * @param hands {key-value}
     * @returns {Array}
     * @constructor
     */
    Hands2Array:function(hands){
        var ret=[];
        logger.debug("hands2Array-hands::"+hands);
        ExObject.eachKeyNum(hands,function(key,value){
            ret.push(key);
            var tmp=value;
            delete tmp;
        });
        return ret;
    }
}